# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models

from account.models import Personnel
# Create your models here.
class Day_money(models.Model):

    day_money = models.IntegerField(15, null=True)
    day_time = models.DateTimeField(auto_now=True)
    day_name = models.CharField(max_length=20, default=str(day_time).split()[0])


class Month_money(models.Model):
    month_money = models.IntegerField(15, null=True)
    month_time = models.DateTimeField(auto_now=True)
    month_name = models.CharField(max_length=20, default=str(month_time).split()[0][:7])
    expend_money = models.IntegerField(15, null=True)
    profit_money = models.IntegerField(15, null=True)


class Years_money(models.Model):
    years_money = models.IntegerField(15, null=True)
    years_time = models.DateTimeField(auto_now=True)
    month_name = models.CharField(max_length=20, default=str(years_time).split()[0][:4])
    expend_money = models.IntegerField(15, null=True)
    profit_money = models.IntegerField(15, null=True)



class Personnel_money(models.Model):
    personnel_name = models.ForeignKey(Personnel, related_name='money_month')
    years_time = models.DateTimeField(auto_now=True)
    money = models.IntegerField(15, null=True)

